Generally, computers have a CPU (central processing unit) for reading program instructions stored in a main memory through a memory control unit and executing the program instructions to process various data and control various devices.
Program instructions are steps of a program (algorithms) for processing data or the like, and a program is normally composed of program instructions as a number of steps.
Some computers effect only simple processing according to a registered small-scale program which is composed of a relatively small number of program instructions. In such computers, a program is already registered in a ROM in the computer. However, a modern computer which carries out a number of data processing operations and control operations is required to have a separate memory means for storing a number of programs and data having a large data length.
It has been customary to employ an auxiliary memory device such as a hard disk drive, an optical disk drive employing a recordable optical disk such as a magnetooptical disk, or a bulk-type semiconductor memory, and connect such an auxiliary memory device to a computer through an interface bus for storing programs and data of large capacity in the auxiliary memory device. According to selective startup or a reading request from an OS (operating system) or an application program, a program or data stored in the auxiliary memory device is read into a main memory device for effecting data processing and controlling operations.
Present trends toward larger-capacity external memory devices have resulted in various techniques proposed to increase the recording capacity of magnetic disks and optical disks.
With the advent of multimedia information processing in recent years, the amount of information required by software applications, e.g., the capacity of programs and the capacity of data handled by programs, has increased at a rate greater than the rate at which the storage capacity of the external memory device increases. Therefore, the data compression technology tends to be more and more important.
One of the data compression techniques which is of the loss-less type (entropy coding or loss-less cording) that causes no data loss is drawing attention because it can increase an apparent capacity when data is recorded in an external memory device and also can effectively use communication lines when data is transmitted.
According to a data compression process based on the loss-less data compression technique, data is compressed by reducing redundant data contained in the data. When the compressed data is expanded, the uncompressed data prior to compression is fully restored without any loss of information.
However, the loss-less data compression technique is of such a nature that a compression ratio at which to compress data, i.e., the ratio of the data length of uncompressed data to the data length of compressed data, remains unknown until all the data is compressed because the compression data varies depending on the content of the data to be compressed.
According to the loss-less data compression technique, furthermore, binary bit map data or the like which has a very high level of redundancy is required to be compressed at a high compression ratio of 5 or more. If data that has already been compressed by a certain data compression process is to be further compressed by the loss-less data compression process, then the data will be expanded in many cases. Therefore, the loss-less data compression technique is very difficult to use.
In the case where data is compressed at a low compression ratio, e.g., in the case where compressed data is of a size which is 99% of original uncompressed data, no merit is attained by data compression since the data length of the uncompressed data and the data length of the compressed data remain almost the same though the data is definitely compressed.
For example, it is assumed that data to be stored in a random-access external memory device such as a magnetic disk drive or the like is compressed to increase an apparent storage capacity of the external memory device. The external memory device stores data in fixed lengths, e.g., blocks of 512 bytes. Therefore, if 1 Kbytes of data are stored in the external memory device, then they are stored over two blocks.
If such 1 Kbytes of data are compressed and the compressed data has a data length of 512 bytes or less, then the compressed data occupies one block of storage area on the disk. Therefore, the size of storage area which is occupied on the disk by the compressed data is 1/2 of the size of storage area which is occupied on the disk by the uncompressed data, an advantage that is offered by the data compression.
However, if the compressed data has a data length greater than 512 bytes, then the compressed data actually occupies two blocks of storage area on the disk even though the data has been compressed, and the size of storage area which is occupied on the disk by the compressed data is the same as the size of storage area which is occupied on the disk by the uncompressed data.
In such a case, the entire system only causes a wasteful expenditure of the time required for data compression (if the data is expanded, the time required for data compression/expansion), and the electric energy required by the CPU and a hardware arrangement dedicated for data compression, and may possibly suffer poor performance due to the data compression. If the compressed data is read from the external memory device for transmission to the computer, then since the data needs to be expanded, the time required for expanding the data is also consumed wastefully.
In communications applications where compressed data is divided into packets of fixed length for transmission, there are instances in which the number of packets occupied by uncompressed data and the number of packets occupied by compressed data may be the same as each other, posing a limitation on efforts to improve the entire system performance.
If data is compressed according to the loss-less data compression process to shorten a time required to transfer data between a computer and an external memory device for the purpose of using communication lines more effectively, then a transfer time t.sub.AC1 required for transmitting the compressed data is shorter than a transfer time t.sub.A1 required for transmitting the uncompressed data, as shown in FIG. 43 of the accompanying drawings.
When the data is compressed, a time t.sub.B1 required for data compression/expansion is newly needed in addition to an actual data transfer time t.sub.C1 However, since the data to be actually transmitted is compressed, the apparent data length is reduced. Therefore, the data compression shortens the transfer time as a whole. In order to shorten the transfer time, it is necessary to compress the data rapidly to reduce the time t.sub.B1 required for data compression/expansion.
If the data is compressed at a low compression ratio, then, as shown in FIG. 44 of the accompanying drawings, because an actual data transfer time t.sub.C2 is not reduced substantially, the addition of a time t.sub.B2 required for data compression/expansion results in a transfer time t.sub.AC2 required for transmitting the compressed data which is longer than a transfer time t.sub.A2 required for transmitting the uncompressed data.
Consequently, the data compression does not offer merits, but instead lowers the overall system performance.
For data transmission between a host computer and an external memory device, the host computer performs the above function of loss-less data compression. With a plurality of external memory devices connected to the host computer, however, a long calculating time is required to compress data for transmitting different data from the host computer to the plural external memory devices, and hence a considerable period of time is necessary until the transfer of data to all the external memory devices is completed.
Stated otherwise, for transmitting different data from the host computer to the plural external memory devices, the host computer is tied up with the data compression, and cannot perform other processing.
Naturally, the apparent storage capacity of only those external memory devices which are connected to a host computer capable of compressing data can be increased. That is, only those external memory devices connected to a host computer capable of compressing data are given the advantages of data compression. An external memory device having a disk on which compressed data is recorded can be operation for data reproduction by only a host computer capable of expanding compressed data.
If an external memory device incorporates a data compression function for allowing individual external memory devices to compress data, then the time required for a host computer to compress data can be eliminated, and a host computer having no data compression capability can enjoy the advantages of data compression at external memory devices, i.e., an increased apparent storage capacity. Such a host computer is then able to handle various programs and data.
A data compression function that can be incorporated in an external memory device may be performed by a loss-less data compression technique by which expanded data is made exactly the same as input data, e.g., the known Huffmann coding technique or LZW (Lempel-Ziv and Welch) coding technique, rather than a data compression technique that causes a data loss, which is used to compress digital audio data converted from analog audio data or digital image data, e.g., the known discrete cosine coding technique. If such a loss-less data compression technique is employed, then the compression ratio varies depending on the contents of supplied data, e.g., depending on how much the same words, the same expressions, etc. are used in the data.
Specifically, if it is assumed that a compression ratio to be expected (hereinafter referred to as an "expected compression ratio") when uncompressed data is compressed by the loss-less data compression technique has a value of 2, then when one logic block of data having a certain data length which is transferred from a host computer is compressed by an external memory device, the compressed data has a data length equal to one physical block whose size is 1/2 of one logic block provided the data is compressed as expected, i.e., the data is compressed at the same compression ratio as the expected compression ratio. In this instance, two physical blocks are equal to one logic block.
Therefore, an optical disk having a physical capacity of 500 MB (MegaByte) has an apparent capacity of 1 GB (GigaByte) as seen from the host computer. However, when the loss-less data compression technique is employed, since the data length of compressed data may not necessarily be 1/2 or less of the data length of the uncompressed data, one logic block of transferred data may not be contained within one physical block.
Inasmuch as data compression may possibly result in data expansion, one logic block of data may be expanded into data over three or more physical blocks. Such a phenomenon occurs when an actual compression ratio is less than 1.
In this case, the system performance is lowered regardless of efforts to increase the performance by increasing the apparent capacity by way of data compression. Specifically, even though data is compressed, a physical capacity which the compressed data occupies on an optical disk remains the same as or is greater than the capacity of one logic block. When the compressed data is to be read, a time is required to expand the compressed data. Consequently, the compressed data occupies the same space on the optical disk as would if the data were not compressed, and an additional time is needed to expand the compressed data when it is to be read. As a result, it is possible for the system to fail to offer any advantages from data compression.
Data is randomly recorded on and reproduced from a magnetic disk or an optical disk. For recording compressed data over two or more physical blocks on an optical disk, for example, the data is randomly recorded in physical blocks, for example.
There are occasions where mutually related compressed data over two or more physical blocks are recorded in physical blocks at spatially spaced positions on a magnetic or optical disk. Such instances manifest themselves where data is to be randomly recorded on a magnetic or optical disk on which data has already been recorded. When data are to be read from the magnetic or optical disk, a seeking (searching) process for searching for the mutually related compressed data is time-consuming, resulting in a long access time.
The present invention has been made in view of the above problems. It is an object of the present invention to provide an apparatus for and a method of transmitting data for increasing overall system performance by transmitting either uncompressed data or compressed data based on the data length of the uncompressed data, the data length of the compressed data, and a preset condition.
Another object of the present invention is to provide an apparatus for and a method of recording data for making it unnecessary to expand recorded data, of the data recorded on a recording medium, whose actual compression ratio satisfies a certain condition, so that the data can be read from the recording medium at a greatly increased rate.
Still another object of the present invention is to provide an apparatus for and a method of recording data for preventing two or more physical blocks of data from being recorded in physical blocks at physically spaced positions, but recording them in areas corresponding to two or more successive physical blocks for thereby effectively shortening a seek time consumed for reading data.